<template>
    <div class="flex items-center">
        <div class="flex-1">
            <span class="cat-item" v-for="item in catlist" :class="{ active: item.value === selected }"
                @click="selected = item.value">{{ item.label }}</span>
        </div>
    </div>
</template>

<script lang="ts">
export default {
    name: 'Catagory'
}
</script>

<script setup lang="ts">
import { defineProps, defineModel } from 'vue';

const props = defineProps(['title', 'catlist'])
const selected = defineModel()
</script>

<style scoped>

.cat-title {
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}
.cat-item {
    padding: 0 10px;
}

.active {
    color: var(--el-color-primary)
}
</style>